home *** CD-ROM | disk | FTP | other *** search
/ Programming Microsoft Visual Basic .NET / Programming Microsoft Visual Basic .NET (Microsoft Press)(X08-78517)(2002).bin / setup / vbnet / 17 controls / customcontrolstest / countdownform.vb < prev    next >
Encoding:
Text File  |  2001-12-15  |  6.7 KB  |  154 lines

  1. Public Class CountdownForm
  2.     Inherits System.Windows.Forms.Form
  3.  
  4. #Region " Windows Form Designer generated code "
  5.  
  6.     Public Sub New()
  7.         MyBase.New()
  8.  
  9.         'This call is required by the Windows Form Designer.
  10.         InitializeComponent()
  11.  
  12.         'Add any initialization after the InitializeComponent() call
  13.  
  14.     End Sub
  15.  
  16.     'Form overrides dispose to clean up the component list.
  17.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  18.         If disposing Then
  19.             If Not (components Is Nothing) Then
  20.                 components.Dispose()
  21.             End If
  22.         End If
  23.         MyBase.Dispose(disposing)
  24.     End Sub
  25.     Friend WithEvents Button1 As System.Windows.Forms.Button
  26.     Friend WithEvents CountdownLabel1 As CustomControlDemo.CountdownLabel
  27.     Friend WithEvents CountdownLabel2 As CustomControlDemo.CountdownLabel
  28.     Friend WithEvents Button2 As System.Windows.Forms.Button
  29.     Friend WithEvents CountdownLabel3 As CustomControlDemo.CountdownLabel
  30.     Friend WithEvents Button3 As System.Windows.Forms.Button
  31.     Friend WithEvents CountdownLabel4 As CustomControlDemo.CountdownLabel
  32.     Friend WithEvents Button4 As System.Windows.Forms.Button
  33.     Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
  34.  
  35.     'Required by the Windows Form Designer
  36.     Private components As System.ComponentModel.Container
  37.  
  38.     'NOTE: The following procedure is required by the Windows Form Designer
  39.     'It can be modified using the Windows Form Designer.  
  40.     'Do not modify it using the code editor.
  41.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  42.         Me.Button2 = New System.Windows.Forms.Button()
  43.         Me.Button3 = New System.Windows.Forms.Button()
  44.         Me.CountdownLabel4 = New CustomControlDemo.CountdownLabel()
  45.         Me.CountdownLabel1 = New CustomControlDemo.CountdownLabel()
  46.         Me.Button4 = New System.Windows.Forms.Button()
  47.         Me.CountdownLabel3 = New CustomControlDemo.CountdownLabel()
  48.         Me.CountdownLabel2 = New CustomControlDemo.CountdownLabel()
  49.         Me.Button1 = New System.Windows.Forms.Button()
  50.         Me.MainMenu1 = New System.Windows.Forms.MainMenu()
  51.         Me.SuspendLayout()
  52.         '
  53.         'Button2
  54.         '
  55.         Me.Button2.Location = New System.Drawing.Point(24, 136)
  56.         Me.Button2.Name = "Button2"
  57.         Me.Button2.Size = New System.Drawing.Size(88, 32)
  58.         Me.Button2.TabIndex = 5
  59.         Me.Button2.Text = "Start"
  60.         '
  61.         'Button3
  62.         '
  63.         Me.Button3.Location = New System.Drawing.Point(272, 32)
  64.         Me.Button3.Name = "Button3"
  65.         Me.Button3.Size = New System.Drawing.Size(88, 32)
  66.         Me.Button3.TabIndex = 5
  67.         Me.Button3.Text = "Start"
  68.         '
  69.         'CountdownLabel4
  70.         '
  71.         Me.CountdownLabel4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
  72.         Me.CountdownLabel4.Font = New System.Drawing.Font("Microsoft Sans Serif", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  73.         Me.CountdownLabel4.Location = New System.Drawing.Point(384, 136)
  74.         Me.CountdownLabel4.Name = "CountdownLabel4"
  75.         Me.CountdownLabel4.Size = New System.Drawing.Size(112, 80)
  76.         Me.CountdownLabel4.TabIndex = 6
  77.         '
  78.         'CountdownLabel1
  79.         '
  80.         Me.CountdownLabel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
  81.         Me.CountdownLabel1.Font = New System.Drawing.Font("Microsoft Sans Serif", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  82.         Me.CountdownLabel1.Location = New System.Drawing.Point(136, 32)
  83.         Me.CountdownLabel1.Name = "CountdownLabel1"
  84.         Me.CountdownLabel1.Size = New System.Drawing.Size(112, 80)
  85.         Me.CountdownLabel1.TabIndex = 6
  86.         '
  87.         'Button4
  88.         '
  89.         Me.Button4.Location = New System.Drawing.Point(272, 136)
  90.         Me.Button4.Name = "Button4"
  91.         Me.Button4.Size = New System.Drawing.Size(88, 32)
  92.         Me.Button4.TabIndex = 5
  93.         Me.Button4.Text = "Start"
  94.         '
  95.         'CountdownLabel3
  96.         '
  97.         Me.CountdownLabel3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
  98.         Me.CountdownLabel3.Font = New System.Drawing.Font("Microsoft Sans Serif", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  99.         Me.CountdownLabel3.Location = New System.Drawing.Point(384, 32)
  100.         Me.CountdownLabel3.Name = "CountdownLabel3"
  101.         Me.CountdownLabel3.Size = New System.Drawing.Size(112, 80)
  102.         Me.CountdownLabel3.TabIndex = 6
  103.         '
  104.         'CountdownLabel2
  105.         '
  106.         Me.CountdownLabel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
  107.         Me.CountdownLabel2.Font = New System.Drawing.Font("Microsoft Sans Serif", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  108.         Me.CountdownLabel2.Location = New System.Drawing.Point(136, 136)
  109.         Me.CountdownLabel2.Name = "CountdownLabel2"
  110.         Me.CountdownLabel2.Size = New System.Drawing.Size(112, 80)
  111.         Me.CountdownLabel2.TabIndex = 6
  112.         '
  113.         'Button1
  114.         '
  115.         Me.Button1.Location = New System.Drawing.Point(24, 32)
  116.         Me.Button1.Name = "Button1"
  117.         Me.Button1.Size = New System.Drawing.Size(88, 32)
  118.         Me.Button1.TabIndex = 5
  119.         Me.Button1.Text = "Start"
  120.         '
  121.         'CountdownForm
  122.         '
  123.         Me.AutoScaleBaseSize = New System.Drawing.Size(7, 17)
  124.         Me.ClientSize = New System.Drawing.Size(520, 253)
  125.         Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.CountdownLabel4, Me.Button4, Me.CountdownLabel3, Me.Button3, Me.CountdownLabel2, Me.Button2, Me.CountdownLabel1, Me.Button1})
  126.         Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  127.         Me.Menu = Me.MainMenu1
  128.         Me.Name = "CountdownForm"
  129.         Me.Text = "Form1"
  130.         Me.ResumeLayout(False)
  131.  
  132.     End Sub
  133.  
  134. #End Region
  135.  
  136.  
  137.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  138.         CountdownLabel1.StartCountdown(5)
  139.     End Sub
  140.  
  141.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  142.         CountdownLabel2.StartCountdown(8)
  143.     End Sub
  144.  
  145.  
  146.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  147.         CountdownLabel3.StartCountdown(10)
  148.     End Sub
  149.  
  150.     Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  151.         CountdownLabel4.StartCountdown(12)
  152.     End Sub
  153. End Class
  154.